﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
	CodeBehind="ApplyList.aspx.cs" Inherits="SBACN.WebSite.Education.ApplyList" %>

<%@ Register Src="../UC/ClientPager.ascx" TagName="Pager" TagPrefix="uc1" %>
<%@ Register Src="~/UC/Navigator.ascx" TagName="Navigator" TagPrefix="uc1" %>
<%@ Register Src="~/UC/Menu.ascx" TagName="Menu" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<script src="../js/plugin/jquery.blockUI.js" type="text/javascript"></script>
	<script type="text/jscript">
		function upfile(id) {
			$jqy("#<%= HidSubjectID.ClientID %>").val(id);
			$jqy.blockUI({
				message: $jqy("#upload_layer"),
				css: {
					top: '30%',
					left: '35%',
					width: '326px',
					hight: '90px'
				}
			})
		}
		function CancelBtnClick() {
			$jqy.unblockUI();
		}
		function Check() {

			var file = $jqy("#<%= FileUpload.ClientID %>").val();
			if (file == "") {
				alert("请选择需要上传的文件！");
				return false;
			}
			var fileArr = file.split("\\"); 
			var fileTArr = fileArr[fileArr.length - 1].toLowerCase().split(".");
			var filetype = fileTArr[fileTArr.length - 1];
			if (filetype != "xls") {
				alert("上传文件必须为后缀名为xls的Excel文件！");
				return false;
			}

			document.getElementById('form1').appendChild(document.getElementById('upload_layer'));
			$jqy.unblockUI();
			$jqy.blockUI({
				message: '<h3>上传处理中，请稍等...</h3>',
				css: {
					top: '30%',
					left: '35%',
					width: '326px',
					hight: '90px'
				}
			});
			return true;
		}
		function Download(ExamID) {
			document.getElementById("<%= Exam_ID.ClientID%>").value = ExamID;
			document.getElementById("<%= btn_Download.ClientID%>").click();
		}
	</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
	<!--主内容区-->
	<div id="wrapper">
		<uc1:Navigator ID="Navigator1" runat="server" />
		<!--左边栏-->
		<uc2:Menu ID="Menu1" runat="server" />
		<!--左边栏-->
	<!--右边栏-->
	<div id="container_r">
		<div id="pic_box">
			<img src="../images/mem_img.jpg" width="756" height="126" /></div>
		<div id="main_rbox">
			<table width="100%" border="0" cellspacing="4" cellpadding="0" id="condition">
				<tr>
					<td width="10%">
						<strong>所属单位:</strong>
					</td>
					<td width="90%">
						<asp:Label ID="MemberName" runat="server" Text=""></asp:Label>
					</td>
				</tr>
			</table>
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="border_collapse">
				<tr>
					<td width="10%" class="grid_title">
						培训时间
					</td>
					<td width="40%" class="grid_title">
						科目
					</td>
					<td width="6%" class="grid_title">
						人数
					</td>
					<td width="12%" class="grid_title">
						报名截止日期
					</td>
					<td width="10%" class="grid_title">
						下载报名表
					</td>
					<td width="10%" class="grid_title">
						上传报名表
					</td>
					<td width="10%" class="grid_title">
					    查看报名表
					</td>
				</tr>
				<asp:Repeater runat="server" ID="ExamList">
					<ItemTemplate>
						<tr>
							<td class="grid_row">
								<%# Convert.ToDateTime(Eval("Deadline")).ToString("yyyy-MM-dd")%>
							</td>
							<td class="grid_row">
								<%# Eval("Subject")%>
							</td>
							<td class="grid_row">
								<%# Eval("Count")%>
							</td>
							<td class="grid_row">
								<%# Convert.ToDateTime(Eval("EndDate")).ToString("yyyy-MM-dd")%>
							</td>
							<td class="grid_row">
								<img src="../images/download_icon.png" /><%# DisplayD(Eval("EndDate").ToString())%>
							</td>
							<td class="grid_row">
								<img src="../images/upload_icon.png" /><%# DisplayU(Eval("EndDate").ToString(),Eval("ID").ToString())%>
							</td>
							<td class="grid_row" style="text-align: center;">
								<a href="javascript:void(0)" onclick="Download(<%# Eval("ID") %>);">下载</a>
							</td>
						</tr>
					</ItemTemplate>
					<AlternatingItemTemplate>
						<tr>
							<td class="grid_row2">
								<%# Convert.ToDateTime(Eval("Deadline")).ToString("yyyy-MM-dd")%>
							</td>
							<td class="grid_row2">
								<%# Eval("Subject")%>
							</td>
							<td class="grid_row2">
								<%# Eval("Count")%>
							</td>
							<td class="grid_row2">
								<%# Convert.ToDateTime(Eval("EndDate")).ToString("yyyy-MM-dd")%>
							</td>
							<td class="grid_row2">
								<img src="../images/download_icon.png" /><%# DisplayD(Eval("EndDate").ToString())%>
							</td>
							<td class="grid_row2">
								<img src="../images/upload_icon.png" /><%# DisplayU(Eval("EndDate").ToString(),Eval("ID").ToString())%>
							</td>
							<td class="grid_row2" style="text-align:center;">
								<a href="javascript:void(0)" onclick="Download(<%# Eval("ID") %>);">下载</a>
							</td>
						</tr>
					</AlternatingItemTemplate>
				</asp:Repeater>
			</table>
			<div id="page">
				<uc1:Pager ID="Pager1" runat="server" PageSize="10" OnSelectedPageIndexChanged="BindSelectedPageIndexChanged" />
			</div>
		</div>
	</div>
	<!--右边栏-->
	<div id="upload_layer" style="display: none;">
		<strong>上传报名表</strong> <span>
			<asp:FileUpload runat="server" CssClass="inputfile" ID="FileUpload" />
			<br />
			<font color="#FF0000">请上传后缀名为xls的Excel文件</font> </span><span>
			<br />
				<asp:HiddenField runat="server" ID="HidSubjectID" />
				<asp:Button id="FileBtn" runat="server" CssClass="btnsearch" Text="确认" OnClientClick="Check();"
					OnClick="Unnamed1_Click" />
				<input type="button" class="btnsearch" value="取消" onclick="CancelBtnClick();" /></span>
	</div>
	<!--右边栏-->
		<div style="display: none;">
			<asp:HiddenField ID="Exam_ID" Value="" runat="server" />
			<asp:Button Text="下载已上传文件" ID="btn_Download" runat="server" OnClick="btn_Download_Click" />
		</div>
	</div>
	<div style="clear: both;">
	</div>
	<!--主内容区-->
</asp:Content>
